'use strict';

const Controller = require('egg').Controller;

class doFormController extends Controller {
    async upload() {
        const { ctx } = this;
        var db = this.app.mongodb;
        var res = await db.collection("roommate").find().toArray();
        console.log(res)
        const result = await ctx.curl('http://123.60.37.66:8081/db/friend/roommate', {
            method: 'POST',
            data: {
                name: 'name',
                age: 'age',
            },
            dataType: 'json',
        });
        
        ctx.body = result;
    }
}

module.exports = doFormController;
